package cn.xlunzi.games.activity

import android.app.Activity
import android.content.Intent
import android.os.Bundle
import android.os.Looper
import cn.xlunzi.games.R
import cn.xlunzi.games.utils.TT
import kotlinx.android.synthetic.main.activity_main.*

class MainActivity : Activity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        btn_pt.setOnClickListener {
            toActivity(PingTuActivity().javaClass)
        }

        btn_sl.setOnClickListener {
            toActivity(SaoLeiActivity().javaClass)
        }

        btn_guess_num.setOnClickListener {
            toActivity(GuessNumActivity().javaClass)
        }

        btn_kf.setOnClickListener {
            TT.show("有什么好的想法，可以告诉我哦！")
        }
    }

    private fun toActivity(javaClass: Class<Activity>) {
        val intent = Intent(this, javaClass)
        startActivity(intent)
    }

//    override fun onCreateOptionsMenu(menu: Menu): Boolean {
//        // Inflate the menu; this adds items to the action bar if it is present.
//        menuInflater.inflate(R.menu.menu_main, menu)
//        return true
//    }
//
//    override fun onOptionsItemSelected(item: MenuItem): Boolean {
//        // Handle action bar item clicks here. The action bar will
//        // automatically handle clicks on the Home/Up button, so long
//        // as you specify a parent activity in AndroidManifest.xml.
//        return when (item.itemId) {
//            R.id.action_settings -> true
//            else -> super.onOptionsItemSelected(item)
//        }
//    }
}
